<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>English Potential Assessment - English Proficiency</title>
    <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" />
    <style>
      body {
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
        background-color: #fff;
        color: #333;
      }

      .dark body {
        background-color: #1a1a1a;
        color: #f5f5f5;
      }

      /* 进度条样式 */
      .progress-container {
        height: 4px;
        width: 100%;
        background-color: #f0f0f0;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
      }

      .progress-bar {
        height: 100%;
        background-color: #007aff;
        width: 50%; /* 8步，第四步 */
      }

      .dark .progress-container {
        background-color: #333;
      }

      /* 顶部导航 */
      .top-nav {
        padding: 1rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
      }

      .back-btn {
        color: #007aff;
        font-size: 1.25rem;
        cursor: pointer;
      }

      /* 内容区域 */
      .content {
        max-width: 500px;
        margin: 0 auto;
        padding: 1rem;
      }

      /* 选项卡片 */
      .option-card {
        padding: 1rem;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        margin-bottom: 1rem;
        cursor: pointer;
        transition: all 0.2s;
      }

      .option-card:hover,
      .option-card.selected {
        border-color: #007aff;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
      }

      .option-card.selected {
        background-color: rgba(0, 122, 255, 0.1);
      }

      .option-title {
        font-weight: 600;
      }

      .option-subtitle {
        color: #6b7280;
        font-size: 0.875rem;
      }

      .option-check {
        display: flex;
        align-items: center;
        justify-content: center;
      }

      /* 按钮样式 */
      .btn-primary {
        background-color: #007aff;
        color: white;
        padding: 0.75rem 1.5rem;
        border-radius: 10px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        display: inline-flex;
        align-items: center;
        width: 100%;
        justify-content: center;
        border: none;
      }

      .btn-primary:hover {
        background-color: #0062cc;
      }

      .btn-primary:disabled {
        background-color: #c7c7cc;
        cursor: not-allowed;
      }

      /* 适配黑暗模式 */
      .dark .option-card {
        border-color: #4a5568;
        background-color: #2d3748;
      }

      .dark .option-card:hover,
      .dark .option-card.selected {
        border-color: #0a84ff;
      }

      .dark .option-card.selected {
        background-color: rgba(10, 132, 255, 0.2);
      }

      .dark .option-subtitle {
        color: #9ca3af;
      }

      /* 主题切换按钮 */
      .theme-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background-color: #007aff;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        z-index: 1000;
      }

      .theme-toggle:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
      }

      /* 模态弹窗样式 */
      .modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 50;
        animation: fadeIn 0.3s ease-out;
      }

      .modal-content {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 85%;
        max-width: 360px;
        background-color: white;
        border-radius: 16px;
        padding: 24px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        animation: scaleIn 0.3s ease-out;
      }

      @keyframes fadeIn {
        from {
          opacity: 0;
        }
        to {
          opacity: 1;
        }
      }

      @keyframes scaleIn {
        from {
          transform: translate(-50%, -50%) scale(0.9);
        }
        to {
          transform: translate(-50%, -50%) scale(1);
        }
      }

      .users-icon {
        position: relative;
        display: flex;
        justify-content: center;
        margin-bottom: 16px;
      }

      .users-icon .user-circle {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        color: white;
        margin: 0 -10px;
      }

      .users-icon .user-circle:nth-child(1) {
        background-color: #3b82f6;
        z-index: 3;
      }

      .users-icon .user-circle:nth-child(2) {
        background-color: #10b981;
        z-index: 2;
      }

      .users-icon .user-circle:nth-child(3) {
        background-color: #8b5cf6;
        z-index: 1;
      }
    </style>
    <script>
      // 检查深色模式
      function checkDarkMode() {
        if (
          localStorage.getItem('darkMode') === 'true' ||
          (localStorage.getItem('darkMode') === null && window.matchMedia('(prefers-color-scheme: dark)').matches)
        ) {
          document.documentElement.classList.add('dark')
          return true
        }
        return false
      }

      // 切换深色/浅色模式
      function toggleDarkMode() {
        if (document.documentElement.classList.contains('dark')) {
          document.documentElement.classList.remove('dark')
          localStorage.setItem('darkMode', 'false')
          document.getElementById('theme-icon').className = 'fas fa-moon'
        } else {
          document.documentElement.classList.add('dark')
          localStorage.setItem('darkMode', 'true')
          document.getElementById('theme-icon').className = 'fas fa-sun'
        }
      }

      function selectOption(element) {
        // 移除所有其他选项的选中状态
        document.querySelectorAll('.option-card').forEach(card => {
          card.classList.remove('selected')
          card.querySelector('.option-check').classList.remove('bg-blue-500')
          card.querySelector('.option-check').innerHTML = ''
        })

        // 添加当前选项的选中状态
        element.classList.add('selected')
        const checkIcon = element.querySelector('.option-check')
        checkIcon.classList.add('bg-blue-500')
        checkIcon.innerHTML = '<i class="fas fa-check text-white text-xs"></i>'

        // 启用下一步按钮
        document.getElementById('next-button').disabled = false
      }

      // 显示模态弹窗
      function showModal() {
        document.getElementById('usersModal').style.display = 'block'
      }

      // 当DOM加载完成
      document.addEventListener('DOMContentLoaded', function () {
        const isDark = checkDarkMode()
        document.getElementById('theme-icon').className = isDark ? 'fas fa-sun' : 'fas fa-moon'
      })
    </script>
  </head>
  <body>
    <!-- 进度条 -->
    <div class="progress-container">
      <div class="progress-bar"></div>
    </div>

    <!-- 顶部导航 -->
    <div class="top-nav">
      <div class="back-btn" onclick="window.location.href='/level.html'">
        <i class="fas fa-arrow-left"></i>
      </div>
      <div class="step-indicator">步骤 4/8</div>
      <div style="width: 24px"></div>
      <!-- 占位，保持布局平衡 -->
    </div>

    <!-- 主内容区 -->
    <div class="content">
      <!-- 页面标题 -->
      <h1 class="text-2xl font-bold mb-2">您当前的英语水平是？</h1>
      <p class="text-gray-600 dark:text-gray-400 mb-8">请选择最接近您当前英语能力的水平</p>

      <!-- 英语水平选项 -->
      <div class="space-y-4 mb-8">
        <div class="option-card" onclick="selectOption(this)" data-value="beginner">
          <div class="flex items-center justify-between">
            <div>
              <div class="option-title">初学者 (A1)</div>
              <div class="option-subtitle">能理解并使用熟悉的日常表达和非常基本的短语</div>
            </div>
            <div class="w-6 h-6 rounded-full border-2 border-gray-300 option-check"></div>
          </div>
        </div>

        <div class="option-card" onclick="selectOption(this)" data-value="elementary">
          <div class="flex items-center justify-between">
            <div>
              <div class="option-title">基础 (A2)</div>
              <div class="option-subtitle">能理解日常使用的句子和表达，能进行简单交流</div>
            </div>
            <div class="w-6 h-6 rounded-full border-2 border-gray-300 option-check"></div>
          </div>
        </div>

        <div class="option-card" onclick="selectOption(this)" data-value="intermediate">
          <div class="flex items-center justify-between">
            <div>
              <div class="option-title">中级 (B1)</div>
              <div class="option-subtitle">能理解熟悉话题的要点，能应对大多数旅行情况</div>
            </div>
            <div class="w-6 h-6 rounded-full border-2 border-gray-300 option-check"></div>
          </div>
        </div>

        <div class="option-card" onclick="selectOption(this)" data-value="upper">
          <div class="flex items-center justify-between">
            <div>
              <div class="option-title">中高级 (B2)</div>
              <div class="option-subtitle">能理解复杂文本的主要内容，能与母语人士流利交流</div>
            </div>
            <div class="w-6 h-6 rounded-full border-2 border-gray-300 option-check"></div>
          </div>
        </div>

        <div class="option-card" onclick="selectOption(this)" data-value="advanced">
          <div class="flex items-center justify-between">
            <div>
              <div class="option-title">高级 (C1-C2)</div>
              <div class="option-subtitle">能理解各种复杂文本，能流利准确地表达自己</div>
            </div>
            <div class="w-6 h-6 rounded-full border-2 border-gray-300 option-check"></div>
          </div>
        </div>
      </div>

      <!-- 下一步按钮 -->
      <button id="next-button" disabled class="btn-primary" onclick="window.location.href='/vocabulary_intro.html'">
        下一步 <i class="fas fa-arrow-right ml-2"></i>
      </button>
    </div>

    <!-- 主题切换按钮 -->
    <div class="theme-toggle" onclick="toggleDarkMode()">
      <i id="theme-icon" class="fas fa-moon"></i>
    </div>

    <!-- 用户数量模态弹窗 -->
    <div id="usersModal" class="modal">
      <div class="modal-content">
        <div class="users-icon">
          <div class="user-circle"><i class="fas fa-user"></i></div>
          <div class="user-circle"><i class="fas fa-user"></i></div>
          <div class="user-circle"><i class="fas fa-user"></i></div>
        </div>
        <h2 class="text-xl font-bold text-center text-gray-800 mb-3">加入全球用户</h2>
        <p class="text-center text-gray-600 mb-6">
          已有超过 <span class="font-bold text-blue-600">1000万+</span> 人正在使用我们的应用进行英语学习
        </p>
        <div class="flex justify-center">
          <a
            href="/vocabulary_intro.html"
            class="bg-blue-500 hover:bg-blue-600 text-white font-semibold py-3 px-6 rounded-full w-full text-center transition-colors duration-300"
          >
            开启学习之旅
          </a>
        </div>
      </div>
    </div>
  </body>
</html>
